/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package xlsBeans;

import com.smartxls.WorkBook;

/**
 *
 * @author Lucas
 */
public class LocalityElementsXLS {
   
    private String continent;
    private String country;
    private String stateorprovince;
    private String county;
    private String municipality;
    private String locality;
    private String waterbody;
    private String islandgroup;
    private String island;
    private String locationaccordingto;
    private String coordinateprecision;
    private String locationremarks;
    private String minimunelevation;
    private String maximumelevation;
    private String minimumdepth;
    private String maximumdepth;
    private Double minimumdistance;
    private Double maximumdistance;
    private String verbatimdepth;
    private String verbatimelevation;
    private String verbatimlocality;
    private String verbatimsrs;
    private String georeferencedby;
    private String georeferencesources;
    private String footprintsrs;

    private int sp;

    public LocalityElementsXLS(){
       
        this.continent = "";
        this.country = "";
        this.stateorprovince = "";
        this.county = "";
        this.municipality = "";
        this.locality = "";
        this.waterbody = "";
        this.islandgroup = "";
        this.island = "";
        this.locationaccordingto = "";
        this.coordinateprecision = "";
        this.locationremarks = "";
        this.minimunelevation = "";
        this.maximumelevation = "";
        this.minimumdepth = "";
        this.maximumdepth = "";
        this.minimumdistance = null;
        this.maximumdistance = null;
        this.verbatimdepth = "";
        this.verbatimelevation = "";
        this.verbatimlocality = "";
        this.verbatimsrs = "";
        this.georeferencedby = "";
        this.georeferencesources = "";
        this.footprintsrs = "";
    }

    public LocalityElementsXLS(WorkBook w, int l, int sp) {
        try{
            setLocalityElements(w, l, sp);
        }catch(Exception e){
            e.printStackTrace();
        }
    }

    public void setLocalityElements(WorkBook w, int l, int sp) throws Exception {
        
        this.continent = w.getText(l, 71 + sp);
        this.country = w.getText(l, 72 + sp);
        this.stateorprovince = w.getText(l, 73 + sp);
        this.county = w.getText(l, 74 + sp);
        this.municipality = w.getText(l, 75 + sp);
        this.locality = w.getText(l, 76 + sp);
        this.waterbody = w.getText(l, 77 + sp);
        this.islandgroup = w.getText(l, 78 + sp);
        this.island = w.getText(l, 79 + sp);
        this.locationaccordingto = w.getText(l, 80 + sp);
        this.coordinateprecision = w.getText(l, 81 + sp);
        this.locationremarks = w.getText(l, 82 + sp);
        this.minimunelevation = w.getText(l, 83 + sp);
        this.maximumelevation = w.getText(l, 84 + sp);
        this.minimumdepth = w.getText(l, 85 + sp);
        this.maximumdepth = w.getText(l, 86 + sp);
        try{
            if(!w.getText(l, 87 + sp).trim().equals(""))
                this.minimumdistance = Double.parseDouble(w.getText(l, 87 + sp).replaceAll(",", "."));
            else this.minimumdistance = null;
        }catch(NumberFormatException e){
            this.minimumdistance = null;
        }
        try{
            if(!w.getText(l, 88 + sp).trim().equals(""))
                this.maximumdistance = Double.parseDouble(w.getText(l, 88 + sp).replaceAll(",", "."));
            else this.maximumdistance = null;
        }catch(NumberFormatException e){
            this.maximumdistance = null;
        }
        this.verbatimdepth = w.getText(l, 89 + sp);
        this.verbatimelevation = w.getText(l, 90 + sp);
        this.verbatimlocality = w.getText(l, 91 + sp);
        this.verbatimsrs = w.getText(l, 92 + sp);
        this.georeferencedby = w.getText(l, 93 + sp);
        this.georeferencesources = w.getText(l, 94 + sp);
        this.footprintsrs = w.getText(l, 95 + sp);
    }

    public boolean isSetLocal(){
        if(this.continent.equals("") && this.country.equals("") && this.stateorprovince.equals("") && this.county.equals("") && this.municipality.equals("") && this.locality.equals("") && this.waterbody.equals("") && this.islandgroup.equals("") && this.island.equals("") && this.locationaccordingto.equals("") && this.coordinateprecision.equals("") && this.locationremarks.equals("") && this.minimunelevation.equals("") && this.maximumelevation.equals("") && this.minimumdepth.equals("") && this.maximumdepth.equals("") && this.minimumdistance == null && this.maximumdistance == null && this.verbatimdepth.equals("") && this.verbatimelevation.equals("") && this.verbatimlocality.equals("") && this.verbatimsrs.equals("") && this.georeferencedby.equals("") && this.georeferencesources.equals("") && this.footprintsrs.equals(""))
            return  false;
        else return true;
    }

    public String getContinent() {
        return continent;
    }

    public void setContinent(String continent) {
        this.continent = continent;
    }

    public String getCoordinateprecision() {
        return coordinateprecision;
    }

    public void setCoordinateprecision(String coordinateprecision) {
        this.coordinateprecision = coordinateprecision;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getCounty() {
        return county;
    }

    public void setCounty(String county) {
        this.county = county;
    }

    
    public String getFootprintsrs() {
        return footprintsrs;
    }

    public void setFootprintsrs(String footprintsrs) {
        this.footprintsrs = footprintsrs;
    }

    public String getGeoreferencedby() {
        return georeferencedby;
    }

    public void setGeoreferencedby(String georeferencedby) {
        this.georeferencedby = georeferencedby;
    }

    public String getGeoreferencesources() {
        return georeferencesources;
    }

    public void setGeoreferencesources(String georeferencesources) {
        this.georeferencesources = georeferencesources;
    }

    public String getIsland() {
        return island;
    }

    public void setIsland(String island) {
        this.island = island;
    }

    public String getIslandgroup() {
        return islandgroup;
    }

    public void setIslandgroup(String islandgroup) {
        this.islandgroup = islandgroup;
    }

    public String getLocality() {
        return locality;
    }

    public void setLocality(String locality) {
        this.locality = locality;
    }

    public String getLocationaccordingto() {
        return locationaccordingto;
    }

    public void setLocationaccordingto(String locationaccordingto) {
        this.locationaccordingto = locationaccordingto;
    }

    public String getLocationremarks() {
        return locationremarks;
    }

    public void setLocationremarks(String locationremarks) {
        this.locationremarks = locationremarks;
    }

    public String getMaximumdepth() {
        return maximumdepth;
    }

    public void setMaximumdepth(String maximumdepth) {
        this.maximumdepth = maximumdepth;
    }

    public Double getMaximumdistance() {
        return maximumdistance;
    }

    public void setMaximumdistance(Double maximumdistance) {
        this.maximumdistance = maximumdistance;
    }

    public String getMaximumelevation() {
        return maximumelevation;
    }

    public void setMaximumelevation(String maximumelevation) {
        this.maximumelevation = maximumelevation;
    }

    public String getMinimumdepth() {
        return minimumdepth;
    }

    public void setMinimumdepth(String minimumdepth) {
        this.minimumdepth = minimumdepth;
    }

    public Double getMinimumdistance() {
        return minimumdistance;
    }

    public void setMinimumdistance(Double minimumdistance) {
        this.minimumdistance = minimumdistance;
    }

    public String getMinimunelevation() {
        return minimunelevation;
    }

    public void setMinimunelevation(String minimunelevation) {
        this.minimunelevation = minimunelevation;
    }

    public String getMunicipality() {
        return municipality;
    }

    public void setMunicipality(String municipality) {
        this.municipality = municipality;
    }

    public int getSp() {
        return sp;
    }

    public void setSp(int sp) {
        this.sp = sp;
    }

    public String getStateorprovince() {
        return stateorprovince;
    }

    public void setStateorprovince(String stateorprovince) {
        this.stateorprovince = stateorprovince;
    }

    public String getVerbatimdepth() {
        return verbatimdepth;
    }

    public void setVerbatimdepth(String verbatimdepth) {
        this.verbatimdepth = verbatimdepth;
    }

    public String getVerbatimelevation() {
        return verbatimelevation;
    }

    public void setVerbatimelevation(String verbatimelevation) {
        this.verbatimelevation = verbatimelevation;
    }

    public String getVerbatimlocality() {
        return verbatimlocality;
    }

    public void setVerbatimlocality(String verbatimlocality) {
        this.verbatimlocality = verbatimlocality;
    }

    public String getVerbatimsrs() {
        return verbatimsrs;
    }

    public void setVerbatimsrs(String verbatimsrs) {
        this.verbatimsrs = verbatimsrs;
    }

    public String getWaterbody() {
        return waterbody;
    }

    public void setWaterbody(String waterbody) {
        this.waterbody = waterbody;
    }


}
